<template>
    <section>
        <el-col>
            <el-table :data="PicData">
                <el-table-column label="缩略图">
                    <template scope="scope">
                        <img :src="scope.row.picUrl" class="min-poster">
                    </template>
                </el-table-column>
                <el-table-column prop="otherText" label="其他文本"></el-table-column>
                <el-table-column inline-template width="130px">
                    <template>
                        <el-tooltip class="tip" placement="top" content="编辑商品图片">
                            <el-button type="primary" size="small" icon="edit" @click="picEdit"></el-button>
                        </el-tooltip>
                        <el-tooltip class="tip" placement="top" content="删除商品图片">
                            <el-button type="danger" size="small" icon="delete"></el-button>
                        </el-tooltip>
                    </template>
                </el-table-column>
            </el-table>
            <el-col :span="24" class="lastCol">
                <el-button type="primary" @click="addPic">添加图片</el-button>
            </el-col>
        </el-col>
    </section>
</template>
<script>
    export default {
        data() {
            return {
                PicData: [{
                    picUrl: 'https://hxty-testing.huamengtong.com/uploads/product/poster/1/thumb_p.png',
                    otherText: '苹果',
                },
                {
                    picUrl: 'https://hxty-testing.huamengtong.com/uploads/product/poster/1/thumb_p.png',
                    otherText: '苹果',
                }],
            }
        },
        methods: {
            picEdit() {
                this.$router.push('/products/undefined/images/:product_item_id/edit');
            },
            addPic() {
                this.$router.push('/products/undefined/images/new');
            }
        }
    }

</script>